const { NotificationService } = require('..');

async function main() {
  try {
    const svc = new NotificationService();
    const results = await svc.send(
      { title: '测试通知', body: '来自 Node 通知服务', text: '来自 Node 通知服务' },
      {
        channels: 'all',
        perChannel: {
          // Bark 额外参数（可选）
          bark: { group: 'Demo' },
          // Email 额外参数（设置收件人）
          email: { to: process.env.DEMO_EMAIL_TO }
        }
      }
    );
    console.log('Send results:', JSON.stringify(results, null, 2));
  } catch (e) {
    console.error('Send failed:', e.message);
    if (e.results) console.error(JSON.stringify(e.results, null, 2));
    process.exitCode = 1;
  }
}

main();


